package com.example.platine.thread;

import android.content.Context;
import android.os.Vibrator;

import com.example.platine.activity.MainActivity;

/**
 * <b> ThreadVibreur est la classe qui gere le thread du vibreur </b>
 * <p>
 *
 * </p>
 * 
 * @author Victor Paumier
 * 
 * @see MainActivity
 */
public class ThreadVibreur extends Thread {

	private Vibrator vibrator ;

	public ThreadVibreur(Context context) {
		vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
	}

	public void arret(){
		vibrator.cancel();
	}


	@Override
	public void run() {
		long[] pattern = {0, 500, 500};
		vibrator.vibrate(pattern,0);
	}
}
